import { Column, Entity } from "typeorm";

@Entity("info", { schema: "qmt-basic" })
export class Info {
  @Column("varchar", {
    name: "exchange_id",
    nullable: true,
    comment: "合约市场代码",
    length: 255,
  })
  exchangeId: string | null;

  @Column("varchar", {
    name: "instrument_id",
    nullable: true,
    comment: "合约代码",
    length: 255,
  })
  instrumentId: string | null;

  @Column("varchar", {
    name: "instrument_name",
    nullable: true,
    comment: "合约名称",
    length: 255,
  })
  instrumentName: string | null;

  @Column("varchar", {
    name: "product_id",
    nullable: true,
    comment: "合约的品种ID(期货)",
    length: 255,
  })
  productId: string | null;

  @Column("varchar", {
    name: "product_name",
    nullable: true,
    comment: "合约的品种名称(期货)",
    length: 255,
  })
  productName: string | null;

  @Column("varchar", {
    name: "exchange_code",
    nullable: true,
    comment: "交易所代码",
    length: 255,
  })
  exchangeCode: string | null;

  @Column("varchar", {
    primary: true,
    name: "uni_code",
    comment: "统一规则代码",
    length: 255,
  })
  uniCode: string;

  @Column("varchar", {
    name: "create_date",
    nullable: true,
    comment: "上市日期(期货)",
    length: 255,
  })
  createDate: string | null;

  @Column("varchar", {
    name: "open_date",
    nullable: true,
    comment: "IPO日期(股票)",
    length: 255,
  })
  openDate: string | null;

  @Column("varchar", {
    name: "expire_date",
    nullable: true,
    comment: "退市日或者到期日",
    length: 255,
  })
  expireDate: string | null;

  @Column("float", {
    name: "float_volume",
    nullable: true,
    comment: "流通股本",
    precision: 12,
  })
  floatVolume: number | null;

  @Column("float", {
    name: "total_volume",
    nullable: true,
    comment: "总股本",
    precision: 12,
  })
  totalVolume: number | null;
}
